<%--
  User: ssl
  Date: 2018-4-16
  Time: 9:54
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script>
    $(function () {
        /* 后台统一异常提示 */
        var error = "${error}";
        if (!!error) {
            notify("错误", error, 'error');
        }
        /* end */
    })
    //提示信息
    function notify(titleStr, msg, typeStr) {
        new PNotify({
            title: titleStr,
            text: msg,
            type: typeStr,
            icon: 'fa fa-' + typeStr,
            styling: 'fontawesome',
            delay: 5000
        });
    }
    //ajax post请求
    function rmsAjax(url, async, type, ajaxData) {
        var result = "";
        if (!async) {
            async = false;
        }
        $.ajax({
            url: url,
            async: async,
            type: type,
            data: ajaxData,
            success: function (data) {
                result = data;
            },
            error: function () {
                notify("错误", "请求发送失败", "error");
            }
        })
        return result;
    }
</script>
